#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QListWidgetItem>
#include "setting.h"
#include <QLabel>
#include <QTimer>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_pbCreate_clicked();

    void on_slaveFunc_currentIndexChanged(int index);

    void on_clear_clicked();

    void on_sendList_itemDoubleClicked(QListWidgetItem *item);

    void on_send_clicked();

    void on_actionSetting_triggered();

    void on_actionConnect_triggered();

    void on_actionDisconnect_triggered();

    void on_slaveData_textChanged(const QString &arg1);


    void on_master_clicked();

    void on_slave_clicked();

    void readyRead();
    void receiveTimeout();

    void on_receiveListClear_clicked();

private:
    Ui::MainWindow *ui;
    Setting::SetInfo m_set;
    QSerialPort m_serialport;
    QLabel *m_serialportInfo;
    QList<QByteArray> m_AduList;
    QByteArray m_receiveBuffer;
    QTimer m_revTimer;
};

#endif // MAINWINDOW_H
